from django.http.response import JsonResponse


def send_success(data: any = "ok") -> JsonResponse:
    return JsonResponse({
        "code": 0,
        "data": data
    })


def send_list(arr=[], total=0) -> JsonResponse:
    return send_success({
       "list": arr,
       "total": total
    })


def send_error(msg='', code=1, data="") -> JsonResponse:
    return JsonResponse({
        "code": code,
        "data": data,
        "msg": msg
    })
